import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../components/layout/index.vue'
const routes = [
  {
    path: '/',
    redirect: '',
    component: () => Layout,
    meta: {
      name: '首页',
      index: '1'
    },
    children:[
      {
        path: '/index',
        meta: {
          name: '首页',
          index: '1-1'
        },
        component: () => import ('../views/home/index.vue'),
      }
    ]
  }, {
    path: '/redbook',
    component: () => Layout,
    meta: {
      name: '小红书',
      index: '2'
    },
    redirect: '',
    children:[
      {
        path: '/redbook/index',
        meta: {
          name: '首页',
          index: '2-1'
        },
        component: () => import ('../views/redbook/index.vue'),
      }
    ]
  }, {
    path: '/image',
    component: () => Layout,
    meta: {
      name: '图片工具',
      index: '3'
    },
    redirect: '',
    children:[
      {
        path: '/image/watermark',
        meta: {
          name: '水印',
          index: '3-1'
        },
        component: () => import ('../views/image/watermark.vue'),
      }, {
        path: '/image/edit',
        meta: {
          name: '编辑',
          index: '3-2'
        },
        component: () => import ('../views/image/edit.vue'),
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
